﻿#include "LineEdit.h"
#include "KeyBoard.h"

LineEdit::LineEdit(QWidget *parent):
    QLineEdit(parent)
{

}

LineEdit::~LineEdit()
{
    KeyBoard *keyboard = KeyBoard::getInstance();
    if(this == keyboard->getReceiver()){
        keyboard->close();
    }
    return;
}

void LineEdit::mousePressEvent(QMouseEvent *e)
{
    if(e && Qt::LeftButton == e->button()){
        KeyBoard *keyboard = KeyBoard::getInstance();
		keyboard->setReceiver(this);
        keyboard->show();
    }
}
